package testGame;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;
import satirGame.Player;

public class TestRole {
	private Player player;
	@Before
	public void setUp() throws Exception {
		player = new Player();
	}

	@Test
	public void testIsNullName() {
		boolean result = false;
		String newName = "AAA";//Test case
		player.setName(newName);
		result = player.isNullName();
		//System.out.println(result);
		assertEquals(result, false);//what the result i want
		//fail("Not yet implemented");
	}
	
	@Test
	public void testRole() {
		int newRole = 1;//Test case
		player.setRole(newRole);
		
		assertEquals(newRole, player.getRole());//what the result i want
		
	}
	
	@Test
	public void testIsContainSymbols() {
		boolean result = false;
		String newName = "%";//if more than one same symbol will have problem
		player.setName(newName);
		result = player.isContainSymbols();
		//System.out.println(result);
		assertEquals(result, true);		
		//fail("Not yet implemented");
	}
	
	
	@Test
	public void testIsContainChar() { //to be continue tomorrow
		boolean result = false;
		String newName = "q";
		player.setName(newName);
		result = player.isContainChar();
		//System.out.println(result);
		assertEquals(result, true);
		//assertEquals(newName, player.getName()); 
		//fail("Not yet implemented");
	}
	
	@Test
	public void testIsnameMaxLengthOverflow(){ //to be continue tomorrow
		boolean result = false;
		String newName = "012345678910";//test 0-10, overflow one number, {true}
		//String newName = "0123456789";//test 0-9,{false}
		player.setName(newName);
		result = player.isnameMaxLengthOverflow();
		System.out.println(result);
		assertEquals(result, true);
		//assertEquals(newName, player.getName());
		//fail("Not yet implemented");
	}
	
}
